import 'package:common/base/base_widget.dart';
import 'package:common/common.dart';

/// Router管理
class RouterManager {
  static const String main = 'main';
  static const String login = 'login';
  static const String agreement = 'agreement';
  static const String forgetPassword = 'forget_password';
  static const String netConfig = '/net_config';
  static const String register = '/register';
  static const String verifyCode = '/verify_code';
  static const String setPassword = '/set_password';

  static Route<dynamic> generateRoute(RouteSettings settings) {
    switch (settings.name) {
      case main:
        return FadeRouter(child: const SimplePage(), settings: settings);
      case login:
        return FadeRouter(child: const SimplePage(), settings: settings);
      case agreement:
        return FadeRouter(child: const SimplePage(), settings: settings);
      case forgetPassword:
        return Right2LeftRouter(child: const SimplePage(), settings: settings);
      default:
        return MaterialPageRoute(builder: (_) => Scaffold(body: Center(child: Text('No route defined for ${settings.name}'))));
    }
  }
}
